package com.cc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("user")
@ResponseBody
public class UserController {

    @RequestMapping("add")
    @ResponseBody
    public String add(){
        System.out.println("add");

        return "add";
    }

    @RequestMapping("update")
    public String update() {

        System.out.println("update");

        return "update";
    }

    @RequestMapping("delete")
    public String delete() {

        System.out.println("delete");

        return "delete";
    }

    @RequestMapping(value = "query",method = RequestMethod.GET)
    public List<String> query(String name,Integer sex) {
        System.out.println(name +"----"+sex);
        System.out.println("query");

        return null;
    }

    @RequestMapping(value = "queryId",method = RequestMethod.GET)
    public List<String> queryId(Integer id) {
        System.out.println(id);
        System.out.println("queryId");

        return null;
    }
}
